package com.pdf.generate_pdf.mapper;

import com.pdf.generate_pdf.entity.GeneratePdfEntity;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @author zzt
 * @date 2021/12/7
 */
@Mapper
public interface GeneratePdfMapper {

    /**
     * 添加模板
     *
     * @param entity
     */
    @Insert("INSERT INTO template_table VALUES (#{entity.id}, #{entity.template})")
    void addTemplateMapper(@Param("entity") GeneratePdfEntity entity);

    /**
     * 生成pdf
     * @param id
     * @return
     */
    @Select("SELECT * FROM template_table WHERE ID = #{id}")
    GeneratePdfEntity queryTemplateByIdMapper(@Param("id") String id);
}
